package com.example.tacocloud.mapper;

import com.example.tacocloud.bean.Ingredient;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
public interface IngredientMapper {

    @Select("select * from Ingredient")
    public List<Ingredient> findAll();

    @Select("select id, name, type from Ingredient where id = #{id}")
    public Ingredient findOne(@Param("id") String id);

    @Insert("insert into Ingredient (id, name, type) values (#{id}, #{name}, #{type})")
    public Ingredient save(Ingredient ingredient);


}
